﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Semantics.Silverlight;
using DanielVaughan;
using SilverlightParser.ServiceReference1;
namespace SilverlightParser
{
    public class WebDialogue
    {
        public string Dialogue(string inputtext)
        {
            DialogueInput input = new DialogueInput();
            input.Input = inputtext;
            var simpleService = ChannelManager.Instance.GetChannel<ParserService>();
            DialogueResult result = SynchronousChannelBroker.PerformAction<DialogueResult, DialogueInput>(
                simpleService.BeginDialogue, simpleService.EndDialogue, input);
            return result.Response;
        }

        public string GetIdentity()
        {
            var simpleService = ChannelManager.Instance.GetChannel<ParserService>();
            string result = SynchronousChannelBroker.PerformAction<string>(
                simpleService.BeginDialogue, simpleService.EndDialogue);
            return result;
        }
    }
}
